'''
Created on Jun 6, 2012

@author: thomas_dao
'''

from google.appengine.ext import ndb
from entity.entity import Note

@ndb.tasklet
def get_by_author(author_key, **q_options):
    qry = Note.query(Note.author == author_key).order(-Note.created_time)
    data = yield qry.fetch_async(20, **q_options)
    raise ndb.Return(data)
